<?  $controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
    $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
?>
<ul>
    
<? if($controller == 'index'):?>
    <h2>Кош келдиниз</h2>
    <? if (!Zend_Auth::getInstance()->hasIdentity()) :?>
        <li> <a href="<?= $this->url(array(
                    'controller'    => 'users',
                    'action'        => 'login'), "", true);?>"><span class="iconsweet">a</span> Кирүү </a></li>
        
        <li> <a href="<?= $this->url(array(
                    'controller'    => 'users',
                    'action'        => 'registration'), "", true);?>"><span class="iconsweet">a</span> Катталуу </a></li>
    <?else:?>
        
    <? endif;?>
<? elseif($controller == 'users'):?>
    <? if (Zend_Auth::getInstance()->hasIdentity()) :?>
    <h2>Профиль</h2>
    <li class="<?= $action == 'index' ?'active' : '';?>"><a href="<?= $this->url(array(
                    'controller'    => 'users',
                    'action'        => 'index',
                    'id'            => Zend_Auth::getInstance()->hasIdentity() ? Zend_Auth::getInstance()->getIdentity()->user_id : ""
                    ), "", true);?>"><span class="iconsweet">a</span>Маалымат</a></li>
    
    <li class="<?= $action == 'view' ?'active' : '';?>"><a href="<?= $this->url(array(
                    'controller'    => 'users',
                    'action'        => 'view',
                    'id'            => Zend_Auth::getInstance()->hasIdentity() ? Zend_Auth::getInstance()->getIdentity()->user_id : ""
                    ), "", true);?>"><span class="iconsweet">k</span>Башкаруу</a></li>
    
    <li class="<?= $action == 'calendar' ?'active' : '';?>"><a href="<?= $this->url(array(
                    'controller'    => 'users',
                    'action'        => 'calendar',
                    'id'            => Zend_Auth::getInstance()->hasIdentity() ? Zend_Auth::getInstance()->getIdentity()->user_id : ""
                    ), "", true);?>"><span class="iconsweet">S</span>Календарь</a></li>
    <li class="<?= $action == 'upload' ?'active' : '';?>"><a href="<?= $this->url(array('controller' => 'users', 'action' => 'upload'), "", true);?>"><span class="iconsweet">J</span>Сүрөт жүктөө</a></li>
    <? endif; ?>
<? elseif ($controller == 'problems' || 
           $controller == 'status'):?>
    <h2>Жыйнак</h2>
    <li class="<?= $controller == 'problems' ?'active' : '';?>"><a href="<?= $this->url(array('controller' => 'problems', 'action' => 'index'), "", true);?>"><span class="iconsweet">a</span> Маселелер </a></li>
    <li class="<?= $controller == 'status'  && ($action == 'index' || $action == 'source') ?'active' : '';?>"><a href="<?= $this->url(array('controller' => 'status', 'action' => 'index'), "", true);?>"><span class="iconsweet">k</span> Сатаус </a></li>
    <li class="<?= $controller == 'status' && $action == 'rating' ?'active' : '';?>"><a href="<?= $this->url(array('controller' => 'status', 'action' => 'rating'), "", true);?>"><span class="iconsweet">o</span> Рейтинг</a></li>
    <li ><a href="#"><span class="iconsweet">S</span> Көп берилүүчү суроолор</a></li>

<? elseif ($controller == 'olymps'):?>
    <h2>Олипиадалар</h2>
    <li><a href="#"><span class="iconsweet">a</span> Студенттик </a></li>    
    <li><a href="#"><span class="iconsweet">o</span> Окуучулар </a></li>
<? elseif ($controller == 'admin'):?>
    <h2>Админ панель</h2>
    <li><a href="<?= $this->url(array('controller' => 'admin','action' => 'inputprob'));?>"><span class="iconsweet">K</span>  Маселе </a></li>
    <li><a href="<?= $this->url(array('controller' => 'admin','action' => 'inputolymp'));?>"><span class="iconsweet">K</span>  Олимпиада </a></li>
    <li><a href="<?= $this->url(array('controller' => 'admin','action' => 'inputalgo'));?>"><span class="iconsweet">K</span>  Алгоритм </a></li>
<? elseif ($controller == 'algorithms'):?>
    <h2>Алгоритмдер</h2>
    <li><a href="#"><span class="iconsweet">K</span> C++ </a></li>
    <li><a href="#"><span class="iconsweet">C</span> C# </a></li>
    <li><a href="#"><span class="iconsweet">J</span> Java </a></li>
<? endif; ?>
</ul>